<template>
  <view class="content">
    <view class="big-head-pic"></view>
    <view class="line">
      <text class="tits">账号</text>
      <input type="text" placeholder="您的账号或手机号" @input="setPhone" />
    </view>
    <view class="line">
      <text class="tits">密码</text>
      <input type="password" placeholder="您的登录密码" @input="setPass" />
    </view>
    <view class="line-red">
      <text class="tits">忘记密码?</text>
      <text class="tits" @click="gotoReg">立即注册</text>
    </view>
    <view class="sure-btn" @click="onLogin">确定</view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      phone: "",
      passwd: "",
    };
  },
  onShow() {},
  methods: {
    gotoReg() {
      return uni.navigateTo({
        url: "/pages/regist/regist",
      });
    },
    setPhone(e) {
      this.phone = e.detail.value;
    },
    setPass(e) {
      this.passwd = e.detail.value;
    },
    onLogin() {
      var that = this;
      var param = { phone: that.phone, passwd: that.passwd };
      //////
      that._post("Login/lophone", param, function (res) {
        if (res.status != "1") {
          return;
        }
        uni.setStorageSync("poxer_ssid", res.data.id);
        uni.switchTab({
          url: "/pages/mine/mine",
        });
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  background-color: #000000;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  padding-top: 150rpx;

  .big-head-pic {
    width: 180rpx;
    height: 180rpx;
    margin: 0 auto;
    margin-bottom: 98rpx;
  }

  .line {
    height: 100rpx;
    display: flex;
    align-items: center;

    box-sizing: border-box;
    padding-left: 23rpx;
    padding-right: 23px;
    box-sizing: border-box;
    font-size: 32rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #ffffff;
    border-bottom: 2rpx solid #272727;

    .tits {
      margin-right: 109rpx;
    }
  }

  .line-red {
    height: 100rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding-left: 23rpx;
    padding-right: 23px;
    box-sizing: border-box;
    font-size: 30rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #db1414;
  }
  .sure-btn {
    margin: 0 auto;
    margin-top: 60rpx;
    width: 710rpx;
    height: 88rpx;
    background: #db1414;
    border-radius: 10rpx;
    font-size: 30rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
</style>
